import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/:pathMatch(.*)",
      redirect: "/home/dashboard"
    },
    {
      path: '/',
      redirect: '/home/dashboard'
    },
    {
      path: '/home',
      redirect: '/home/dashboard',
      name: 'home',
      component: () => import('../views/Home.vue'),
      meta: { name: "home" },
      children: [
        {
          path: '/home/dashboard',
          name: 'dashboard',
          component: () => import('../views/Dashboard.vue'),
          meta: { name: "dashboard" },
        },
        {
          path: '/home/arketingTasks',
          name: 'arketingTasks',
          component: () => import('../views/ArketingTasks.vue'),
          meta: { name: "arketingTasks" },
        }
     ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue'),
      meta: { name: "login" }
    }
  ],
})

export default router
